package com.code.platform.elastic;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

/**
 * elasticjob测试类
 *
 * @author liuyj
 * @create 2017-05-18 16:50
 **/
public class MyElasticJob  implements SimpleJob{

//
//    @Autowired
//    private BookAuthorMapper bookAuthorMapper;


    @Override
    public void execute(ShardingContext shardingContext) {
//        logger.info(String.format("Item: %s | Time: %s | Thread: %s | %s",
//                shardingContext.getShardingItem(), new SimpleDateFormat("HH:mm:ss").format(new Date()), Thread.currentThread().getId(), "SIMPLE"));
//            this.getData();
    }


//    public void getData(){
//        BookAuthorExample bookAuthorExample = new BookAuthorExample();
//        List<BookAuthor> bookAuthors = bookAuthorMapper.selectByExample(bookAuthorExample);
//        for (BookAuthor b: bookAuthors) {
//            logger.info(b.getId().toString());
//        }
//    }




}
